<template>

    <div id="app">
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/AdminIndex' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>{{$route.name}}</el-breadcrumb-item>
        </el-breadcrumb>
        <el-row style="margin-top: 20px" :gutter="20">

            <el-col :span="4">
                <el-input prefix-icon="el-icon-search" placeholder="输入关键字搜索" v-model="key"></el-input>
            </el-col>
            <el-col :span="1">
                <el-button type="primary" @click="search">搜索</el-button>
            </el-col>

        </el-row>
        <el-card shadow="never" style="margin-top: 20px;">
            <el-table :data="data" border stripe style="margin-bottom: 20px">
                <!--     <el-table-column type="index">
                     </el-table-column>-->
                <el-table-column prop="id" label="活动编号">
                </el-table-column>
                <el-table-column prop="img" label="图片">
                    <template scope="scope">
                        <el-image style="width: 200px;cursor: pointer" :src="scope.row.img" lazy
                                  @click="go(scope.row)"></el-image>
                    </template>
                </el-table-column>
                <el-table-column prop="tissue" label="所属组织">
                </el-table-column>
                <el-table-column prop="title" label="活动名称">
                </el-table-column>
                <el-table-column prop="type" label="活动类型">
                </el-table-column>

                <el-table-column prop="zmrs" label="招募人数">
                </el-table-column>
                <el-table-column prop="ybm" label="已报名人数">
                </el-table-column>
                <el-table-column prop="ctime" label="活动时间">
                </el-table-column>
                <el-table-column prop="ctime" label="更新时间">
                </el-table-column>
                <el-table-column prop="state" label="状态">
                    <template scope="scope">
                        <el-tag>{{scope.row.state}}</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="操作" width="400">
                    <template scope="scope">
                        <el-button type="primary" size="small" @click="go(scope.row)">查看活动</el-button>
                        <el-button type="success" size="small">点击审核</el-button>
                        <el-button type="warning" size="small">取消活动</el-button>
                        <el-button type="danger" size="small">删除活动</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <el-pagination
                    @current-change="handleCurrentChange"
                    :current-page="currentPage"
                    :page-sizes="[100, 200, 300, 400]"
                    :page-size="100"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="400">
            </el-pagination>
        </el-card>
    </div>
</template>

<script>
    var t;
    export default {
        name: "AdminActivity",
        data() {
            return {
                data: [
                    {
                        id: 1,
                        img: 'http://jmva.jiangmen.cn/images/7.jpg',
                        title: '慰问退休医生',
                        type: '公益',
                        tissue: '外联部',
                        zmrs: '777',
                        ybm: '666',
                        state: '待审核',
                        ctime: '1999.05.22',
                    }
                ],
                currentPage: 1,
                key: '',
            }
        },
        created() {
            t = this;
        },
        mounted() {

        },
        methods: {
            handleCurrentChange(p) {
                t.currentPage = p;
                this.init();
            },
            go(b) {
                this.$router.push({
                    path: '/ActivityInfo',
                    query: {
                        id: b.id,
                    }
                })
            }
        },
        beforeDestroy() {

        },
        props: {},
        computed: {//计算属性

        },
    }
</script>

<style scoped>

</style>
